//-----------------------------------------------------------------
// Includes
//-----------------------------------------------------------------
#include <Viewer/Material.hpp>
#include <GL/gl.h>

namespace Viewer
{
	Material::Material( float r, float v, float b ):couleur(r,v,b)
	{
		
	}

	Material::~Material()
	{
	}

	void Material::Draw()
	{	
		GLfloat no_mat[] = { 0.0f,0.0f,0.0f,1.0f };
		GLfloat mat_diffuse[] = { couleur.x,couleur.y,couleur.z,1.0f };
		GLfloat mat_specular[] = { 1.0f,1.0f,1.0f,1.0f };
		GLfloat mat_shininess[] = { 100.0f };

		glMaterialfv(GL_FRONT,GL_AMBIENT,no_mat);
		glMaterialfv(GL_FRONT,GL_DIFFUSE,mat_diffuse);
		glMaterialfv(GL_FRONT,GL_SPECULAR,mat_specular);
		glMaterialfv(GL_FRONT,GL_SHININESS,mat_shininess);
		glMaterialfv(GL_FRONT,GL_EMISSION,no_mat);
	}

	void Material::SetR( float r )
	{
		couleur.x = r;
	}
	void Material::SetV( float v )
	{
		couleur.y = v;
	}

	void Material::SetB( float b )
	{
		couleur.z = b;
	}


}// fin de namespace Viewer
